<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
        <title>小伙伴信息</title>
        <link rel="stylesheet" href="http://cdn.amazeui.org/amazeui/2.4.2/css/amazeui.min.css">
        <style>
            body{background-color:#eee;}
            p{padding:5px;}
            hr{border:5px solid white;}
        </style>
    </head>
    <body>
        
        <header data-am-widget="header" class="am-header am-header-default">
            <h1 class="am-header-title">
                <a href="#title-link" class="">
                    小伙伴信息
                </a>
            </h1>
        </header>
        
        <p>
            <button type="button" class="am-btn am-btn-success" onclick="addPeople();">添加小伙伴</button>
        </p>
        <hr>
        <div id="content"></div>
        <script id="t" type="text/html"></script>
        
       <div class="am-popup" id="my-popup">
  <div class="am-popup-inner">
    <div class="am-popup-hd">
      <h4 class="am-popup-title">熊孩子</h4>
      <span data-am-modal-close
            class="am-close">&times;</span>
    </div>
    <div class="am-popup-bd">
        
        <form method="POST" action="/admin/account/doEdit" class="am-form">
            
            <div class="am-form-group">
                <label for="username">昵称</label>
                <input type="text" class="" name="username" id="username" placeholder="请输入一个可爱的名字啦" required>
           </div>
            
            <div class="am-form-group">
                <label for="studyNumber">学号</label>
                <input type="text" class="" name="studyNumber" id="studyNumber" placeholder="学号是唯一标识，一定要输入真的" required>
           </div>
            
            <div class="am-form-group">
                <label for="sex">性别</label>
                <select id="sex" name="sex">
                    <option>熊汉子</option>
                    <option>熊妹子</option>
                </select>
           </div>
            
            <div class="am-form-group">
                <label for="work">职位</label>
                <select id="work" name="work">
                    <option>萌萌的</option>
                    <option>大UI</option>
                    <option>前端设计</option>
                    <option>后台研发</option>
                    <option>公关</option>
                    <option>运营</option>
                    <option>全栈</option>
                    <option>root</option>
                    <option>熊孩子</option>
                </select>
           </div>
            
            <p>
                 <button type="submit" class="am-btn am-btn-success">保存</button>
            </p>
        
        </form>
        
        
        
    </div>
  </div>
</div>
       
        <script src="http://apps.bdimg.com/libs/jquery/1.9.1/jquery.min.js"></script>
        <script src="http://cdn.amazeui.org/amazeui/2.4.2/js/amazeui.min.js"></script>
        <script src="/static/template.js"></script>
        <script>
            $(document).ready(function(){
                $.get("/admin/account/all", {}, function(obj){
                    $.get("/static/2.html", {}, function(html){
                        $("#t").html(html);
                        var data = template("t", {"lists": obj});
                        $("#content").html(data);
                    });
                });
            });
            function addPeople(){
                updateData("","","","");
            }
            function updateData(studyNumber, sex, username, work){
                $("#studyNumber").val(studyNumber);
                $("#sex").val(sex);
                $("#username").val(username);
                $("#work").val(work);
                $('#my-popup').modal("open");
            }
        </script>
    </body>
</html>
